import req from "@/utils/request.ts";
import {
  LoginFormType,
  LoginResponseType,
  UserResponseType,
} from "@/types/userType";

enum API {
  LOGIN_URL = "/user/login",
  USERINFO_URL = "/user/info",
}

// 登录接口模拟
export const reqLogin = (data: LoginFormType) =>
  req.post<any, LoginResponseType>(API.LOGIN_URL, data);

// 用户信息模拟
export const reqUserInfo = () =>
  req.get<any, UserResponseType>(API.USERINFO_URL);

// 列表数据模拟
export const listArr = () =>
  req.get<any, UserResponseType>("../../../src/assets/list.json");
